#include "ServerScoreCard.h"

ServerScoreCard::ServerScoreCard(NetworkHandler *toSend, int target){
	score = 0;
	scoreAltered = 0;
	handler = toSend;
	tgt = target;
}

void ServerScoreCard::updateState(){
	if(scoreAltered){
		scoreAltered = 0;
		SDLNet_Write32(score, buffer);
		handler->addBroadcastMessage(buffer, 4, tgt);
	}
	//addScore(1);
}

void ServerScoreCard::alertToInput( const InputSet& input ){}

void ServerScoreCard::draw( Engine* game ){}

void ServerScoreCard::setScore(int newScore){
	score = newScore;
	scoreAltered = 1;
}

void ServerScoreCard::addScore(int toAdd){
	score += toAdd;
	scoreAltered = 1;
}
